{extend name="$base" /}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="ADMIN_CSS/member_list.css" />
<script type="text/javascript" src="__STATIC__/My97DatePicker/WdatePicker.js"></script>

{/block}
{block name="main"}
<div class="set-style">
	<dl>
		<dt>开启状态:</dt>
		<dd>
			{if condition="$integralConfig['auto_integral'] eq 1"}开{else}关{/if}
		</dd>
	</dl>
	<dl>
		<dt>本次挖矿会员数量:</dt>
		<dd>
			{$member_count} 人
		</dd>
	</dl>
	<dl>
		<dt>全网总算力:</dt>
		<dd>
			{$stock_count} 个
		</dd>
	</dl>
	<dl>
		<dt>已挖出加密货币数量:</dt>
		<dd>
			{$hpcoin_count} 个
		</dd>
	</dl>
	<dl>
		<dt><span class="required">*</span>今天挖矿总额:</dt>
		<dd>
			<input name="send_money" id="send_money" type="number"  value="0" min="0"  onkeyup="value=value.replace(/[^\d+(\.\d+)?]/g,'')" > 个
			<p class="error">请输入今天挖矿数量</p>
			<p class="hint">请输入今天挖矿数量</p>
		</dd>
	</dl>
	<button class="edit_button" onclick="addGift();">提交</button>
</div>

<script>	
     var flag = false;//防止重复提交
	//保存
	function addGift(){
        var send_money = $("#send_money").val();

        if (send_money == '' || send_money == 0 ) {
            $("#send_money").next().show().css("display","inline-block");
            $("#send_money").focus();
            return false;
        } else {
            $(".error").hide();
        }
		flag = true;


        $.ajax({
			type : "post",
			url : "ADMIN_MAIN/mine/addMine",
            data : {
                'send_money' : send_money
            },
			async : true,
			success : function(data) {
				//alert(JSON.stringify(data));
				if (data["code"] > 0) {
					showMessage('success', data["message"]);
					 location.href="ADMIN_MAIN/mine/digList.html";
				}else{
					showMessage('error', data["message"]);
				}	
				flag = false;
			}
		});
	}
</script>
{/block}